<!DOCTYPE html>
<html>
	<head>
		<title>{{ title.title }} - {{ title.discription }}</title>
		{% include 'admin/common/header.html' %}
		<link rel="stylesheet" href="{{ url_for('static', filename='admin/css/loader.css') }}" />
		<link rel="stylesheet" href="{{ url_for('static', filename='admin/css/admin.css') }}" />
	</head>
	<body class="layui-layout-body pear-admin">
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<div class="layui-logo">
					<img class="logo">
					<span class="title"></span>
				</div>
				<ul class="layui-nav layui-layout-left">
					<li class="collapse layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
					<li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading = 600></a></li>
				</ul>
				<div id="control" class="layui-layout-control"></div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
					<li class="layui-nav-item layui-hide-xs"><a href={{ url_for('main.index')}} class="layui-icon layui-icon-website"></a></li>
					<li class="layui-nav-item layui-hide-xs message"></li>
					<li class="layui-nav-item user">
						<a class="layui-icon layui-icon-username" href="javascript:;"></a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
						</dl>
					</li>
					<li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
				</ul>
			</div>
			<div class="layui-side layui-bg-black">
				<div class="layui-logo">
					<img class="logo">
					<span class="title"></span>
				</div>
				<div class="layui-side-scroll">
					<div id="sideMenu"></div>
				</div>
			</div>
			<div class="layui-body">
				<div id="content"></div>
			</div>
			<div class="layui-footer layui-text">
				<span class="left">
					Released under the MIT license.
				</span>
				<span class="center"></span>
				<span class="right">
					Copyright © 2023-2024
				</span>
			</div>
			<div class="pear-cover"></div>
			<div class="loader-main">
				<div class="loader"></div>
			</div>
		</div>
		<div class="pear-collapsed-pe collapse">
			<a href="#" class="layui-icon layui-icon-shrink-right"></a>
		</div>
		{% include 'admin/common/footer.html' %}
		<script>
			layui.use(['admin','popup'], function() {
				var admin = layui.admin;
				var popup = layui.popup;
				
				admin.setConfigType("json");
				admin.setConfigPath("{{ url_for('admin.configs') }}");
				
				admin.render();
                admin.logout(function () {
                    let loading = layer.load()
                    $.ajax({
                      url: "{{ url_for('admin.logout') }}",
                      dataType: 'json',
                        async: false,
                      type: 'post',
                      success: function (result) {
                        layer.close(loading)
                        if (result.success) {
                          popup.success(result.msg, function () {
                            location.href = "{{ url_for('main.index') }}"
                          })
                          return true
                        }
                      }
                    })
                })
				admin.message(function(id, title, context, form) {});
			})
		</script>		
	</body>
</html>
